package com.project.blog.controller;

import com.project.blog.common.result.Result;
import com.project.blog.entity.Category;
import com.project.blog.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/categorys")
public class CategoryController {




    @Autowired
    private CategoryService categoryService;

    @GetMapping
   // @LogAnnotation(module = "文章分类", operation = "获取所有文章分类")
    public Result listCategorys() {


        List<Category> categorys = categoryService.findAll();

        return Result.success(categorys);
    }

}
